INCLUDE_DIRECTORIES( . network protocol test)
INCLUDE_DIRECTORIES(${SERVER_SOURCE_DIR}/share )
INCLUDE_DIRECTORIES(${SERVER_SOURCE_DIR}/thirdparty/tinyxml2 )
#INCLUDE_DIRECTORIES(${SERVER_SOURCE_DIR}/thirdparty/tsf4g_lib/include)
INCLUDE_DIRECTORIES(${SERVER_SOURCE_DIR}/thirdparty/lua-5.1.4/src )
INCLUDE_DIRECTORIES(${SERVER_SOURCE_DIR}/thirdparty/toluapp/include )
INCLUDE_DIRECTORIES(${SERVER_SOURCE_DIR}/thirdparty/mysql/include )
#LINK_DIRECTORIES(${LIBRARY_OUTPUT_PATH})

LINK_DIRECTORIES( /usr/lib64/mysql )
LINK_DIRECTORIES( ${SERVER_SOURCE_DIR}/thirdparty/lua-5.1.4/lib )
LINK_DIRECTORIES( ${SERVER_SOURCE_DIR}/thirdparty/toluapp/lib )


FILE(GLOB_RECURSE SRC_LIST *.cpp)
AUX_SOURCE_DIRECTORY(${SERVER_SOURCE_DIR}/protocol/pb SRC_LIST)
AUX_SOURCE_DIRECTORY(${SERVER_SOURCE_DIR}/thirdparty/tinyxml2 SRC_LIST)
AUX_SOURCE_DIRECTORY(${SERVER_SOURCE_DIR}/share/idip SRC_LIST)
AUX_SOURCE_DIRECTORY(${SERVER_SOURCE_DIR}/share/tsssdk SRC_LIST)
AUX_SOURCE_DIRECTORY(${SERVER_SOURCE_DIR}/share/role SRC_LIST)
AUX_SOURCE_DIRECTORY(${SERVER_SOURCE_DIR}/share/version SRC_LIST)
AUX_SOURCE_DIRECTORY(${SERVER_SOURCE_DIR}/share/util SRC_LIST)
AUX_SOURCE_DIRECTORY(${SERVER_SOURCE_DIR}/share/define SRC_LIST)
AUX_SOURCE_DIRECTORY(${SERVER_SOURCE_DIR}/share/guild SRC_LIST)
AUX_SOURCE_DIRECTORY(${SERVER_SOURCE_DIR}/share/rolesummary SRC_LIST)
AUX_SOURCE_DIRECTORY(${SERVER_SOURCE_DIR}/share/test SRC_LIST)
AUX_SOURCE_DIRECTORY(${SERVER_SOURCE_DIR}/share/table SRC_LIST)
AUX_SOURCE_DIRECTORY(${SERVER_SOURCE_DIR}/share/skycitycfg SRC_LIST)
AUX_SOURCE_DIRECTORY(${SERVER_SOURCE_DIR}/share/config SRC_LIST)
AUX_SOURCE_DIRECTORY(${SERVER_SOURCE_DIR}/share/tablemgr SRC_LIST)
AUX_SOURCE_DIRECTORY(${SERVER_SOURCE_DIR}/share/utildb SRC_LIST)
AUX_SOURCE_DIRECTORY(${SERVER_SOURCE_DIR}/share/reportdata SRC_LIST)
AUX_SOURCE_DIRECTORY(${SERVER_SOURCE_DIR}/share/profile SRC_LIST)
AUX_SOURCE_DIRECTORY(${SERVER_SOURCE_DIR}/share/script SRC_LIST)
#AUX_SOURCE_DIRECTORY(${SERVER_SOURCE_DIR}/share/match SRC_LIST)
AUX_SOURCE_DIRECTORY(${SERVER_SOURCE_DIR}/share/custombattle SRC_LIST)
AUX_SOURCE_DIRECTORY(${SERVER_SOURCE_DIR}/share/team SRC_LIST)
AUX_SOURCE_DIRECTORY(${SERVER_SOURCE_DIR}/share/common SRC_LIST)
AUX_SOURCE_DIRECTORY(${SERVER_SOURCE_DIR}/share/serverinfo SRC_LIST)
AUX_SOURCE_DIRECTORY(${SERVER_SOURCE_DIR}/share/reload SRC_LIST)
AUX_SOURCE_DIRECTORY(${SERVER_SOURCE_DIR}/share/reswar SRC_LIST)

LIST(APPEND SRC_LIST ${SERVER_SOURCE_DIR}/share/tlogwriter.cpp
					 ${SERVER_SOURCE_DIR}/share/appid.cpp
					 ${SERVER_SOURCE_DIR}/share/DBInfo.cpp
					 ${SERVER_SOURCE_DIR}/share/HashUtil.cpp
					 ${SERVER_SOURCE_DIR}/share/functionopenbase.cpp
					 ${SERVER_SOURCE_DIR}/share/WebFetchThread.cpp
                     ${SERVER_SOURCE_DIR}/share/match/matchlimit.cpp
                     ${SERVER_SOURCE_DIR}/share/match/matchmachine.cpp)


ADD_EXECUTABLE(gameserver ${SRC_LIST})
TARGET_LINK_LIBRARIES(gameserver common mysql mysqlclient tolua++ lua pthread protobuf z dl curl)


set_target_properties(gameserver PROPERTIES COTIRE_CXX_PREFIX_HEADER_INIT "pch.h")
cotire(gameserver)
